/*
 * @Date: 2025-01-19 18:20:26
 * @LastEditors: zl 1077167261@qq.com
 * @LastEditTime: 2025-02-12 20:40:56
 * @FilePath: \vue-admin\src\api\CarCard.js
 *
 */
import request from "@/utils/request";
//1---------------------------------------月卡管理
/**
 * 获取楼宇列表
 * @param
 * @returns
 */
export function getCardListAPI(params) {
  return request({
    url: "/parking/card/list",
    params,
  });
}
//新增月卡
export function createCardAPI(data) {
  return request({
    url: "/parking/card",
    method: "POST",
    data,
  });
}
/**
 * 获取月卡详情
 * @data
 * @returns
 */
export function getCardDetailAPI(id) {
  return request({
    url: `/parking/card/detail/${id}`,
  });
}
// 编辑月卡
export function updateCardAPI(data) {
  return request({
    url: "/parking/card/edit",
    method: "PUT",
    data,
  });
}
/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export function delCardAPI(id) {
  return request({
    url: `/parking/card/${id}`,
    method: "DELETE",
  });
}
/**
 * 批量删除月卡
 * @param {*} id
 * @returns
 */
export function delCardListAPI(idList) {
  return request({
    url: `/parking/card/${idList.join(",")}`,
    method: "DELETE",
  });
}
//2------------------------------------------------------------行车管理-计费规则管理

/**
 * 获取规则列表
 * @param { page, pageSize} params
 * @returns
 */
export function getRuleListAPI(params) {
  return request({
    url: "parking/rule/list",
    params,
  });
}
/**
 * 创建规则
 * @returns
 */
export function createRuleAPI(data) {
  return request({
    url: "/parking/rule",
    method: "POST",
    data,
  });
}
